package com.example.bootdemo.repository;

import com.example.bootdemo.pojo.UserRole;
import org.springframework.data.jpa.repository.JpaRepository;
import org.springframework.data.jpa.repository.Modifying;
import org.springframework.data.jpa.repository.Query;

import java.util.List;

public interface UserRoleRepository extends JpaRepository<UserRole,Long> {

   @Modifying
   @Query(value="delete from tbl_user_role where user_id=?1 and role_id=?2",nativeQuery = true)
   int deleteUserRoleByUnionId(Long userId,String roleId);

   List<UserRole> findByUserId(Long userId);



}
